package org.hxyjs.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author 
 */
public class Advertisers implements Serializable,Account {
    private String adno;

    private String ano;

    private String adname;

    private String adid;

    private String adpwd;

    private Integer adstate;

    private String adphone;

    private String adimg;

    private String addescribe;

    String salt;//加密用的盐

    Integer isDelete;

    Date createDate;

    List<AccountRole> accountRoles;

    public String getSalt() {
        return salt;
    }

    @Override
    public Boolean getLocked() {
        return null;
    }

    @Override
    public String getCredentialsSalt() {
        return getAccountname() + salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @Override
    public String getAccountid() {
        return adno;
    }

    @Override
    public String getAccountname() {
        return adname;
    }

    @Override
    public String getPassword() {
        return adpwd;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public List<AccountRole> getAccountRoles() {
        return accountRoles;
    }

    public void setAccountRoles(List<AccountRole> accountRoles) {
        this.accountRoles = accountRoles;
    }

    private static final long serialVersionUID = 1L;



    public String getAdno() {
        return adno;
    }

    public void setAdno(String adno) {
        this.adno = adno;
    }

    public String getAno() {
        return ano;
    }

    public void setAno(String ano) {
        this.ano = ano;
    }

    public String getAdname() {
        return adname;
    }

    public void setAdname(String adname) {
        this.adname = adname;
    }

    public String getAdid() {
        return adid;
    }

    public void setAdid(String adid) {
        this.adid = adid;
    }

    public String getAdpwd() {
        return adpwd;
    }

    public void setAdpwd(String adpwd) {
        this.adpwd = adpwd;
    }

    public Integer getAdstate() {
        return adstate;
    }

    public void setAdstate(Integer adstate) {
        this.adstate = adstate;
    }

    public String getAdphone() {
        return adphone;
    }

    public void setAdphone(String adphone) {
        this.adphone = adphone;
    }

    public String getAdimg() {
        return adimg;
    }

    public void setAdimg(String adimg) {
        this.adimg = adimg;
    }

    public String getAddescribe() {
        return addescribe;
    }

    public void setAddescribe(String addescribe) {
        this.addescribe = addescribe;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Advertisers other = (Advertisers) that;
        return (this.getAdno() == null ? other.getAdno() == null : this.getAdno().equals(other.getAdno()))
            && (this.getAno() == null ? other.getAno() == null : this.getAno().equals(other.getAno()))
            && (this.getAdname() == null ? other.getAdname() == null : this.getAdname().equals(other.getAdname()))
            && (this.getAdid() == null ? other.getAdid() == null : this.getAdid().equals(other.getAdid()))
            && (this.getAdpwd() == null ? other.getAdpwd() == null : this.getAdpwd().equals(other.getAdpwd()))
            && (this.getAdstate() == null ? other.getAdstate() == null : this.getAdstate().equals(other.getAdstate()))
            && (this.getAdphone() == null ? other.getAdphone() == null : this.getAdphone().equals(other.getAdphone()))
            && (this.getAdimg() == null ? other.getAdimg() == null : this.getAdimg().equals(other.getAdimg()))
            && (this.getAddescribe() == null ? other.getAddescribe() == null : this.getAddescribe().equals(other.getAddescribe()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAdno() == null) ? 0 : getAdno().hashCode());
        result = prime * result + ((getAno() == null) ? 0 : getAno().hashCode());
        result = prime * result + ((getAdname() == null) ? 0 : getAdname().hashCode());
        result = prime * result + ((getAdid() == null) ? 0 : getAdid().hashCode());
        result = prime * result + ((getAdpwd() == null) ? 0 : getAdpwd().hashCode());
        result = prime * result + ((getAdstate() == null) ? 0 : getAdstate().hashCode());
        result = prime * result + ((getAdphone() == null) ? 0 : getAdphone().hashCode());
        result = prime * result + ((getAdimg() == null) ? 0 : getAdimg().hashCode());
        result = prime * result + ((getAddescribe() == null) ? 0 : getAddescribe().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", adno=").append(adno);
        sb.append(", ano=").append(ano);
        sb.append(", adname=").append(adname);
        sb.append(", adid=").append(adid);
        sb.append(", adpwd=").append(adpwd);
        sb.append(", adstate=").append(adstate);
        sb.append(", adphone=").append(adphone);
        sb.append(", adimg=").append(adimg);
        sb.append(", addescribe=").append(addescribe);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}